m, k = map(int, input().split())
if m % 19 == 0:
    s = 0
    while m > 0:
        if m % 10 == 3:
            s = s + 1
        m = m // 10
    if s == k:
        print("YES")
    else:
        print("NO")
else:
    print("NO")
